'use strict';

let Koa=require('koa');
let temp=require('./templating');
let controllers=require('./controllers');
let koa_static=require('koa-static')
let bodyParser=require('koa-bodyparser')
let model =require("./models");
let session=require('./session')
let app=new Koa();

app.use(session(app))
app.use(bodyParser())
app.use(temp);
app.use(koa_static(__dirname))
app.use(controllers());



/* (async ()=>{
    console.log('正在初始化数据表。。。');
    await model.sync();
})();
 */
let port=8000;
app.listen(port);
console.log(`http://127.0.0.1:${port}`);